-- GENERATED SPELL FOR [Shadowmoon Darkcaster] --


function spell0_17694(pUnit, Event) --@Fear,n/a--
pUnit:FullCastSpellOnTarget(12542,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17694', 5500, 1)
end

function spell1_17694(pUnit, Event) --@Rain of Fire,n/a--
pUnit:FullCastSpellOnTarget(11990,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17694', 9000, 1)
end

function spell2_17694(pUnit, Event) --@Rain of Fire,n/a--
pUnit:FullCastSpellOnTarget(33508,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17694', 9000, 1)
end

function spell3_17694(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(12471,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17694', 3000, 1)
end

function spell4_17694(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(15232,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17694', 3000, 1)
end

function Sorts_17694(pUnit, Event)
local choix_sorts_17694 = math.random(0, 4)
if choix_sorts_17694 == 0 then
pUnit:RegisterEvent('spell0_17694', 1, 1)
end
if choix_sorts_17694 == 1 then
pUnit:RegisterEvent('spell1_17694', 1, 1)
end
if choix_sorts_17694 == 2 then
pUnit:RegisterEvent('spell2_17694', 1, 1)
end
if choix_sorts_17694 == 3 then
pUnit:RegisterEvent('spell3_17694', 1, 1)
end
if choix_sorts_17694 == 4 then
pUnit:RegisterEvent('spell4_17694', 1, 1)
end
end

function mob17694_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_17694', math.random(1500, 3000), 1)
end

function mob17694_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob17694_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob17694_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(17694, 1, 'mob17694_Action')
RegisterUnitEvent(17694, 2, 'mob17694_Leave')
RegisterUnitEvent(17694, 3, 'mob17694_Kill')
RegisterUnitEvent(17694, 4, 'mob17694_Die')
